package com.zgr.newhospital.controller;

import com.zgr.newhospital.entity.User;
import com.zgr.newhospital.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 郑国荣
 * @Date: 2023-07-20-0:54
 * @Description:
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/addUser")
    public int addUser(@RequestBody User user){
        return userService.addUser(user);
    }

    @GetMapping("/getUser")
    public User getUserByid(@RequestParam int uid){
       return userService.getUserByID(uid);
    }
}
